<template>
	<view class="cineme-item-style">
		<view class="cinema-info-item" @click="handleClick">
			<view class="cinema-top-box">
				<view class="cinema-name-text overflow">{{item.nm}}</view>
				<text class="cinema-noSession-text" v-if="item.price == 999999.0">暂无排期</text>
				<view class="cinema-money-box overflow" v-else>
					<text>{{item.price}}</text>起
				</view>
			</view>
			<view class="cinema-address-box">
				<text class="overflow">{{item.addr}}</text>
				<view class="cinemaItemDistance" v-if="item.hall_type.length <= 0 && item.tp != 1">
					<image src="/static/img/other/cinemaItemDistanceIcon.png" mode="" style="width: 24rpx;height: 24rpx;" class="cinemaItemDistanceIcon"></image>
					<text class="text-distance">{{item.distance}}</text>km
				</view>
			</view>
			<view class="tag-list-box" v-if="item.hall_type.length > 0 || item.tp == 1">
				<view class="tag-list-box-left">
					<view class="public-tag small-con blue-plain-tag" v-if="isSearch">小吃</view>
					<view class="public-tag small-con red-plain-tag" v-if="isSearch">取票机</view>
					<view class="public-tag small-con red-solid-tag" v-if="item.tp == 1">特惠</view>
					<view class="public-tag small-con blue-plain-tag" v-if="item.tp == 1">取票机</view>
					<view class="public-tag small-con gray-plain-tag" v-for="(tag, tagIndex) in item.hall_type" :key="tagIndex">{{tag}}</view>
				</view>
				<view class="cinemaItemDistance">
					<image src="/static/img/other/cinemaItemDistanceIcon.png" mode="" style="width: 24rpx;height: 24rpx;" class="cinemaItemDistanceIcon"></image>
					<text class="text-distance">{{item.distance}}</text>km
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		props: {
			item: {
				type: Object,
				default: {}
			},
			isSearch: {
				type: Boolean,
				default: false
			}
		},
		methods: {
			handleClick() {
				this.$emit('click', this.item)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.cineme-item-style {
		.cinema-info-item {
			padding: 20rpx 0;
			border-bottom: 2rpx solid rgba(0, 0, 0, .05);
	
			.cinema-top-box {
				display: flex;
				justify-content: space-between;
				align-items: center;
	
				.cinema-name-text {
					font-size: 30rpx;
					color: #333;
				}
				.cinema-noSession-text {
					font-size: 24rpx;
					color: #999;
					display: flex;
					align-items: center;
				}
				.cinema-money-box {
					font-size: 24rpx;
					color: #999;
					display: flex;
					align-items: center;
	
					text {
						font-size: 30rpx;
						color: #f1255d;
						margin-right: 10rpx;
	
						// font-weight: bold;
						&::before {
							content: '￥';
							font-size: 80%;
							margin-right: 4rpx;
						}
					}
				}
			}
	
			.cinema-address-box {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-top: 20rpx;
	
				>text {
					font-size: 24rpx;
					color: #999;
				}
				
				.cinemaItemDistance {
					display: flex;
					align-items: center;
					.cinemaItemDistanceIcon {
						margin-right: 4rpx;
					}
					.text-distance {
						max-width: 120rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
				}
			}
	
			.tag-list-box {
				margin-top: 20rpx;
				display: flex;
				justify-content: space-between;
				.tag-list-box-left {
					display: flex;
				}
				.cinemaItemDistance {
					display: flex;
					align-items: center;
					.cinemaItemDistanceIcon {
						margin-right: 4rpx;
					}
					.text-distance {
						max-width: 120rpx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
				}
			}
		}
	}
</style>
